﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Automobile.service.Common;
using Automobile.service.DAL;
using Automobile.service.Model;
using System.Data;
namespace Automobile.service.BLL
{
   public class MemberCardBLL
    {
       MemberCardDAL dal = new MemberCardDAL();
        /// <summary>
        /// 获取会员记录总行数
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
       public int CountMemberCard(string firstdate, string lastdate, string MemberCard_owner)
        {
            return dal.CountMemberCard(firstdate,lastdate,MemberCard_owner);
        }
        /// <summary>
        /// 删除会员信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DelMemberCard(string id)
        {
            return dal.DelMemberCard(id);
        }
        /// <summary>
        /// 添加会员信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int AddMemberCard(MemberCard m)
        {
            return dal.AddMemberCard(m);
        }
        /// <summary>
        /// 分页显示会员信息(查询)
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public DataTable SearchMemberCard(int index, int size, string firstdate, string lastdate, string MemberCard_owner)
        {
            return dal.SearchMemberCard(index, size, firstdate, lastdate, MemberCard_owner);
        }
        /// <summary>
        /// 会员信息填充下拉框
        /// </summary>
        /// <returns></returns>
        public DataTable ShowMenberCard()
        {
            return dal.ShowMenberCard();
        }
        /// <summary>
        /// 根据id获取会员信息
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public DataTable GetMemberCardByID(int id)
        {
            return dal.GetMemberCardByID(id);
        }
        /// <summary>
        /// 修改会员信息
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public int UptMemberCardByID(MemberCard m)
        {
            return dal.UptMemberCardByID(m);
        }
        /// <summary>
        /// 修改状态会员
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int UptMemberCard_StateByID(int MemberCard_Id, int MemberCard_State)
        {
            return dal.UptMemberCard_StateByID(MemberCard_Id, MemberCard_State);
        }
        
    }
}
